/*
45 Answers
Print the numbers of form 2^i.5^j in increasing order. For eg:
1, 2, 4, 5, 8, 10, 16, 20
*/
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <fstream>
#include <set>

using namespace std;

void output()
{
    priority_queue<pair<int, int>, vector<pair<int, int> > , greater<pair<int, int> >  > pq;
   // pq.push(make_pair(1, 0));
    pq.push(make_pair(3, 3));
    pq.push(make_pair(5, 5));
   
    for (int i = 0; i < 20; i++) {
        pair<int, int> top = pq.top();
        pq.pop();
        cout << top.first << " " << top.second << endl;
        if (top.second == 3) { cout << "Push: " << top.first*3 << endl; pq.push(make_pair(top.first*3, 3)); }
        if (top.second == 3) {cout << "Push: " << top.first*5 << endl;pq.push(make_pair(top.first*5, 3)); }
        if (top.second == 5) {cout << "Push: " << top.first*5 << endl; pq.push(make_pair(top.first*5, 5)); }
    } 
}


int main(int argc, char **argv)
{
    output();
}
